using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WiMo.Games.Drawables
{
    public abstract class SpriteTextBase : SpriteBase, ISpriteText
    {
        private ISpriteFont _font;
        public virtual ISpriteFont Font
        {
            get
            {
                return _font;
            }
            set
            {
                if(_font != value)
                {
                    Invalidate();
                    _font = value;
                }
            }
        }
        private string _text;
        public virtual string Text
        {
            get
            {
                return _text;
            }
            set
            {
                if(_text != value)
                {
                    Invalidate();
                    //If the text changed, we need to resize the graphic.
                    Size = Size.Zero;
                    _text = value;
                }
            }
        }
        private Color _foreColor;
        public virtual Color ForeColor
        {
            get
            {
                return _foreColor;
            }
            set
            {
                if(_foreColor != value)
                {
                    Invalidate();
                    _foreColor = value;
                }
            }
        }
        private Color _backgroundColor;
        public virtual Color BackgroundColor
        {
            get
            {
                return _backgroundColor;
            }
            set
            {

                if(_backgroundColor != value)
                {
                    Invalidate();
                    _backgroundColor = value;
                }
            }
        }
    }
}
